home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amiga / nduk / os-include / inline / colorwheel.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-12-16  |  1.3 KB  |  52 lines

  1. #ifndef _INLINE_COLORWHEEL_H
  2. #define _INLINE_COLORWHEEL_H
  3.  
  4. #include <sys/cdefs.h>
  5. #include <inline/stubs.h>
  6.  
  7. __BEGIN_DECLS
  8.  
  9. #ifndef BASE_EXT_DECL
  10. #define BASE_EXT_DECL extern struct ColorWheelBase*  ColorWheelBase;
  11. #endif
  12. #ifndef BASE_PAR_DECL
  13. #define BASE_PAR_DECL
  14. #define BASE_PAR_DECL0 void
  15. #endif
  16. #ifndef BASE_NAME
  17. #define BASE_NAME ColorWheelBase
  18. #endif
  19.  
  20. static __inline void 
  21. ConvertHSBToRGB (BASE_PAR_DECL struct ColorWheelHSB *hsb,struct ColorWheelRGB *rgb)
  22. {
  23.   BASE_EXT_DECL
  24.   register struct ColorWheelBase* a6 __asm("a6") = BASE_NAME;
  25.   register struct ColorWheelHSB *a0 __asm("a0") = hsb;
  26.   register struct ColorWheelRGB *a1 __asm("a1") = rgb;
  27.   __asm __volatile ("jsr a6@(-0x1e)"
  28.   : /* no output */
  29.   : "r" (a6), "r" (a0), "r" (a1)
  30.   : "a0","a1","d0","d1", "memory");
  31. }
  32. static __inline void 
  33. ConvertRGBToHSB (BASE_PAR_DECL struct ColorWheelRGB *rgb,struct ColorWheelHSB *hsb)
  34. {
  35.   BASE_EXT_DECL
  36.   register struct ColorWheelBase* a6 __asm("a6") = BASE_NAME;
  37.   register struct ColorWheelRGB *a0 __asm("a0") = rgb;
  38.   register struct ColorWheelHSB *a1 __asm("a1") = hsb;
  39.   __asm __volatile ("jsr a6@(-0x24)"
  40.   : /* no output */
  41.   : "r" (a6), "r" (a0), "r" (a1)
  42.   : "a0","a1","d0","d1", "memory");
  43. }
  44. #undef BASE_EXT_DECL
  45. #undef BASE_PAR_DECL
  46. #undef BASE_PAR_DECL0
  47. #undef BASE_NAME
  48.  
  49. __END_DECLS
  50.  
  51. #endif /* _INLINE_COLORWHEEL_H */
  52.